package com.qdu.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.qdu.entity.Housetype;
import com.qdu.mapper.HousetypeMapper;
import com.qdu.service.HousetypeService;

@Service
public class HousetypeServiceImpl implements HousetypeService {

	@Autowired
	private HousetypeMapper houseMapper;
	
	@Override
	public Housetype gethousebyuidandhid(String uid, String hid) {
		return houseMapper.selectbyuidandhid(uid, hid);
	}

	@Override
	public List<Housetype> getallHouseList() {
		return houseMapper.selectAll();
	}

	@Override
	public List<Housetype> getHouseByuid(String uid) {
		return houseMapper.selectbyuid(uid);
	}

	@Override
	public List<Housetype> getHouseByprice(String high, String low) {
		return houseMapper.selectbyhprice(high, low);
	}

	@Override
	public List<Housetype> getHouseBytopic(String key) {
		return houseMapper.selectbyhtopic(key);
	}

	@Override
	public List<Housetype> getHouseByatt(String att) {
		return houseMapper.selectbyhatt(att);
	}

	@Override
	public void addHouse(Housetype House) {
		houseMapper.insert(House);
	}

	@Override
	public void updateHouse(Housetype House) {
		houseMapper.update(House);
	}

	@Override
	public void deleteHouse(String uid, String hid) {
		houseMapper.delete(uid, hid);
	}
	
	@Override
	public void modifyatt(String uid,String hid,String att){
		Housetype house=houseMapper.selectbyuidandhid(uid, hid);
		house.setHatt(att);
		houseMapper.update(house);
	}
	
	
}
